package com.think.teaching.model;

import java.util.Date;
import java.sql.Timestamp;
import java.time.LocalDateTime;

import org.springframework.format.annotation.DateTimeFormat;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.think.common.model.Result;
import com.think.common.utils.Common;

import io.swagger.annotations.ApiModelProperty;

public abstract class BaseModel<T extends Model<T>> extends Model<T> {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	 /**
     * 创建人
     */
    @ApiModelProperty(hidden = true)
    protected Integer createdBy;

    /**
     * 创建时间
     */
    @ApiModelProperty(hidden = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    protected Timestamp createdTime;

    /**
     * 更新人
     */
    @ApiModelProperty(hidden = true)
    protected Integer updatedBy;

    /**
     * 更新时间
     */
    @ApiModelProperty(hidden = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    protected Timestamp updatedTime;

    /**
     * 删除标记
     */
    
    @ApiModelProperty(value = "状态", allowableValues = "0, 1",hidden = true)
    protected Integer delflag;

    /**
     	* 状态
     */
    @ApiModelProperty(value = "状态", allowableValues = "1, 0")
    protected Integer state;
    
    public Integer getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(Integer createdBy) {
        this.createdBy = createdBy;
    }

    public Timestamp getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Timestamp createdTime) {
        this.createdTime = createdTime;
    }

    public Integer getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(Integer updatedBy) {
        this.updatedBy = updatedBy;
    }

    public Timestamp getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(Timestamp updatedTime) {
        this.updatedTime = updatedTime;
    }

    public Integer getDelflag() {
        return delflag;
    }

    public void setDelflag(Integer delflag) {
        this.delflag = delflag;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }
    
    
    public Result CheckObjectComplete() {
    	updatedBy = Common.GetCurrentAuthor().getUserId();
		return Result.success();
	}

}
